#include <iostream>
using namespace std;

int FeeCount(float a, char b)
{
    if (!a)
        return 0;
    int tmp = a, count = 0;
    if(a<=1)
        count += 20;
    else
    {
        count += 20;
        a -= 1;
        if (a - (int)a > 0)
            count += (a + 1);
        else
            count += a;
    }
    if (b == 'y')
        count += 5;
    return count;

}

int main()
{
    float a;
    char b;
    cin >> a >> b;
    int ret = FeeCount(a, b);
    cout << ret << endl;
    return 0;
}
